<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
	<%@ include file="include.jsp"%>   
	<link rel="stylesheet" type="text/css" href="<%=basePath %>thirtpart/dhtmlx25/dhtmlxlayout.css"/>
	<link rel="STYLESHEET" type="text/css" href="<%=basePath %>thirtpart/dhtmlx25/dhtmlxtree.css"/>
    <link rel="stylesheet" type="text/css" href="<%=basePath %>thirtpart/dhtmlx25/skins/dhtmlxlayout_dhx_blue.css"/>
	<script src="<%=basePath %>thirtpart/dhtmlx25/dhtmlxcommon.js"></script>
	<script src="<%=basePath %>thirtpart/dhtmlx25/dhtmlxlayout.js"></script> 
	<script src="<%=basePath %>thirtpart/dhtmlx25/dhtmlxcontainer.js"></script>  
	<script  src="<%=basePath %>thirtpart/dhtmlx25/dhtmlxtree.js"></script>    
	
	
	<style>
		html, body {
			width: 100%;
			height: 100%;
			margin: 0px;
			padding: 0px;
			overflow: hidden;
		}
	</style>
	 
</head>
<body> 
<div id="treeboxbox_tree" style="width:98%; height:100%;align:center;bordercolor:#9966cc;border-right :2px solid Silver;"></div>
  
<script>
var dhxLayout;

//tree
tree = new dhtmlXTreeObject("treeboxbox_tree", "98%", "100%", 0);
tree.enableTreeLines(true);
tree.setSkin('dhx_blue');
tree.setImagePath("<%=basePath %>thirtpart/dhtmlx25/imgs/csh_dhx_skyblue/");
tree.enableDragAndDrop(0); 
//tree.setImageArrays("plus", "", "", "", "plus.gif");
//tree.setImageArrays("minus", "", "", "", "minus.gif");
//tree.setStdImages("book.gif", "books_open.gif", "books_close.gif");  
 
//tree.setOnOpenHandler(tonopen);
//tree.attachEvent("onOpenEnd", function(nodeId, event) {
//    doLog("An id of open item is " + nodeId);
//});
tree.setOnClickHandler(tonclick);
//tree.setOnCheckHandler(toncheck);
//tree.setOnDblClickHandler(tondblclick);


tree.setXMLAutoLoading("<%=basePath %>menutree.do");
tree.loadXML("<%=basePath %>menutree.do");



function viewContent(itemId) {  
     var userData = tree.getUserData(itemId,"url"); 
      if(typeof(userData) == 'undefined' || userData == ''|| userData == 'null'){
      	return;
     }else{
 	    var url = "<%=basePath %>"+ userData + "?menuid=" + itemId;
 	    var currurl = "<%=basePath %>currentMenu.do?menuid=" + itemId;
	    if(null != url && 'undefined' != url){
	       window.parent.cont.current.frameElement.src=currurl; 
	       window.parent.cont.content.frameElement.src=url; 
 
	    }else{
	      alert(url);
	      } 
      }
}
function tonclick(id) {
    viewContent(id);
};
function tondblclick(id) {
    viewContent(id);
};

function tonopen(id, mode) {
    return confirm("Do you want to " + (mode > 0 ? "close": "open") + " node " + tree.getItemText(id) + "?");
}; 
function doOnLoad() {
    var dhxLayoutData = {
        parent: "parentId",
        pattern: "2U",
        cells: [{
            id: "a",
            text: "&nbsp;",
            width:200 
            }, {
            id: "b",
            text: "&nbsp;" 
        }]
        };
    dhxLayout = new dhtmlXLayoutObject(dhxLayoutData);
    dhxLayout.cells("a").attachObject("treeboxbox_tree"); 
    dhxLayout.setAutoSize("a;b", "a;b");
    dhxLayout.cells("a").hideHeader();
    dhxLayout.cells("b").hideHeader();
	
}
	</script>
</body>
</html>
<script>

</script>
